#coding:utf-8
# 建立基本分析要素——代码块（所有元素的始祖）
class CodeBlock:
    _rawcode = ""
    _blocks = []
    _analyzed = False
    def setcode(self, code):
        self._rawcode = code

# =========五大基本代码块(原始块)===========
# 控制块
class ControlBlock(CodeBlock):
# 变量块
    pass
class VariableBlock(CodeBlock):
    pass
# 函数块
class FunctionBlock(CodeBlock):
    _rawcode = []
    def __init__(self, CodeArray):
        self._rawcode = CodeArray
# 执行块
class ExecutionBlock(CodeBlock):
    pass
# 类型块
class TypeBlock(CodeBlock):
    
    pass 

# ===========控制衍生代码块============
class IfBlock(ControlBlock):
    pass

class LoopBlock(ControlBlock):
    pass

# ===========变量衍生代码块============
class LocalBlock(VariableBlock):
    _local_vals = {} #
    pass

class GlobalBlock(VariableBlock):
    _global_vals = [] # ("name", "type", value(often directly gotten))
    pass

# ===========函数衍生代码块============
class DeclearBlock(FunctionBlock):
    pass

class DefinitionBlock(FunctionBlock):
    # 函数的定义方式是 :
    # function XX takes YY t1, ZZ t2, ... returns MMM tm
    # endfunction
    _take_list = [] # [("name", "type"), ....]
    # _return_list = [] # [("name", "type"), ....]
    _return_type = ""

    _name = ""


# ===========执行衍生代码块============
class CalculationBlock():
    pass

class CallBlock():
    pass

class ReturnBlock():
    pass

class AssignBlock():
    pass

# ===========类型衍生代码块============
